Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
ml-peak-shape-generator
Advanced tools
[![NPM version][npm-image]][npm-url] [![build status][ci-image]][ci-url] [![npm download][download-image]][download-url]
Peak shape generator, the current kind of shapes supported are:
Name | Equation |
---|---|
Gaussian | |
Lorentzian | |
Pseudo Voigt |
where
$ npm i ml-peak-shape-generator
import { gaussian, lorentzian, pseudoVoigt} from 'ml-peak-shape-generator';
// It's possible to specify the windows size with factor option
let {data, fwhm} = gaussian({factor: 3.5, sd: 500});
// or fix the number of points as Full Width at Half Maximum
let {data, fwhm} = gaussian({factor: 3.5, fwhm: 500});
// It's possible to specify the windows size with factor option
let {data, fwhm} = loretzian({factor: 5, fwhm: 500});
// It's possible to specify the windows size with factor option
let {data, fwhm} = pseudoVoigt({{factor: 5, fwhm: 500}});
import { getShape, GAUSSIAN, LORENTZIAN, PSEUDO_VOIGT} from 'ml-peak-shape-generator';
// If you want to dynamically select a shape you can use the `getShape` method.
let {data, fwhm} = getShape(LORENTZIAN, {factor: 3.5, sd: 500});
It is also possible to get a function that allows to calculate y for any x
import { gaussianFct} from 'ml-peak-shape-generator';
const func = gaussianFct({ x: 0, y: 2, width: 0.2 });
You can create a class as well and add many peaks
const peakShapeGenerator = new PeakShapeGenerator({cacheSize:20});
let shape = peakShapeGenerator.getShape(GAUSSIAN, { fwhm: 500 });
let shape2 = peakShapeGenerator.getShape(GAUSSIAN, { fwhm: 500 });
// shape===shape2 true
let shape3 = peakShapeGenerator.getShape(GAUSSIAN, { fwhm: 100 });
// shape===shape3 false
let shape4 = peakShapeGenerator.getShape(GAUSSIAN, { fwhm: 100 });
// shape3===shape4 true
FAQs
Generate various peak shapes
We found that ml-peak-shape-generator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.